package com.emep.emeptime.service;


import com.emep.emeptime.entity.SysAreaInfo;
import com.emep.emeptime.repository.SysAreaInfoRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author xy
 * @Description: 行政区划业务层
 * @date 2018/2/24 14:06
 * @version V1.0
 */
@Service
public class SysAreaInfoService {
    @Resource
    private SysAreaInfoRepository areaInfoRepository;
    private static final Logger logger = LoggerFactory.getLogger(SysAreaInfoService.class);

    /**
     *
     * 根据AreaName查询行政区划
     *
     * @param areaName
     * @return
     */
    public SysAreaInfo findAreaByAreaName(String areaName){
        SysAreaInfo areaInfo = null;
        try {
            areaInfo = areaInfoRepository.findSysAreaInfoByNameLike(areaName);
        }catch (Exception e){
            logger.error(e.getLocalizedMessage());
        }
        return areaInfo;
    }


}
